package com.lincong.controller.superadmin;

import com.lincong.entity.bo.HeadLine;
import com.lincong.entity.dto.Result;
import com.lincong.service.solo.HeadLineService;
import org.simpleframework.core.annotation.Controller;
import org.simpleframework.inject.annotation.Autowired;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author linchong
 * @version 1.0
 * @Date: 2022-05-11 13:55
 * @Description: HeadLineOperationController$
 */
@Controller
public class HeadLineOperationController {

	@Autowired
	private HeadLineService headLineService;

	public Result<Boolean> addHeadLine(HttpServletRequest req,HttpServletResponse resp){
		//todo:参数校验以及请求参数转化
		return headLineService.addHeadLine(new HeadLine());
	}

	public Result<Boolean> removeHeadById(HttpServletRequest req,HttpServletResponse resp){
		//todo:参数校验以及请求参数转化
		return headLineService.removeHeadById(1);
	}

	public Result<Boolean> modifyHeadLine(HttpServletRequest req,HttpServletResponse resp){
		//todo:参数校验以及请求参数转化
		return headLineService.addHeadLine(new HeadLine());
	}

	public Result<HeadLine> queryHeadLineById(HttpServletRequest req,HttpServletResponse resp){
		//todo:参数校验以及请求参数转化
		return headLineService.queryHeadLineById(1);
	}

	public Result<List<HeadLine>> queryHeadLine(HttpServletRequest req,HttpServletResponse resp){
		//todo:参数校验以及请求参数转化
		return headLineService.queryHeadLine(new HeadLine(),1,100);
	}
}
